feat: add notifications for account delegation#12935
Conversation
cbb141d to
e58a3f6
Compare
4c7c5b7 to
db6ddb3
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughDelegationService now accepts Account objects and current user IDs, triggers notifications on delegation changes, and the controller, notification system, and tests are updated to support the refactored signatures and new notification behavior. ChangesAccount Delegation with Notifications
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/Unit/Service/DelegationServiceTest.php (1)
177-189: ⚡ Quick winAssert that no notification is sent when undelegation target does not exist.
This branch currently verifies deletion is skipped, but not that
IManager::notifyis skipped too.Proposed test strengthening
public function testUnDelegateWhenNotFound(): void { $this->mockNotification(); + $this->notificationManager->expects($this->never()) + ->method('notify'); + $this->delegationMapper->expects($this->once()) ->method('find') ->with(1, 'delegatee') ->willThrowException(new DoesNotExistException('Not found'));
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d7d080e5-d6ca-4d23-92b8-6cc947971454
📒 Files selected for processing (6)
lib/Controller/DelegationController.phplib/Notification/Notifier.phplib/Service/DelegationService.phptests/Unit/Controller/DelegationControllerTest.phptests/Unit/Notification/NotifierTest.phptests/Unit/Service/DelegationServiceTest.php
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
AI-assisted: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
db6ddb3 to
dc0799b
Compare
Part of #12403

Unit tests Ai-assisted
Summary by CodeRabbit
New Features
Tests